package me.softwareengineer.guice.rendering.listener;

import java.util.Map;

import me.softwareengineer.guice.rendering.domain.Format;
import me.softwareengineer.guice.rendering.domain.FormatElement;
import me.softwareengineer.guice.rendering.domain.HasMetaData;
import me.softwareengineer.guice.rendering.domain.HasProperties;

/**
 * Called to notify about a {@link FormatElement}.
 * 
 * 
 * <pre>
 * This class is thread-safe and immutable.
 * </pre>
 * 
 * @author yadtahir
 * @since 1.0
 * @see FormatElement
 * @see StartElementEvent
 */
public final class StartFormatEvent extends Event implements
		StartElementEvent {
	private Format style;

	/**
	 * Creates a begin format event
	 * 
	 * @param style
	 *            the format type
	 * @param properties
	 *            the properties of the element. For more info, see
	 *            {@link HasProperties}
	 * @param metadata
	 * 			the metadata of the element. For more details, check {@link HasMetaData}
	 */
	public StartFormatEvent(Format style, Map<String, String> properties, Map<String, Object> metadata) {
		super(properties, metadata);
		this.style = style;

	}

	/**
	 * @return the formatting to apply to the children elements
	 */
	public Format getStyle() {
		return style;
	}

}
